package string;

public class IndexOfDemo {
    public static void main(String[] args) {
        //          0123456789012345
        String str="thinking in Java";
        System.out.println(str.indexOf("in"));//2
        System.out.println(str.indexOf("in",3));//5
        System.out.println(str.indexOf("in",6));//9
        System.out.println(str.lastIndexOf("in"));//9
        System.out.println(str.indexOf("kkk"));//-1
    }
}
